package Entity;

import java.util.Date;

/**
 * This is an entity for saving the parking place inside of the parking lot.
 * @author Or Marx
 *
 */
public class ParkingSpot {

	/**
	 * is an enum for the status of the parking spot (in use, free, disabled or saved).
	 */
	public enum pSpot {IN_USE,FREE,DISABLED,SAVED};
	private pSpot status;
	private String carNumber;
	private Date endParkTime;
	/**
	 * is the constructor which only make the status of the parking spot as free.
	 * if the status!=in_use the other fields (carNumber and endParkiTime) has no meaning. 
	 */
	public ParkingSpot()
	{
		status=pSpot.FREE;
	}

	public pSpot getStatus() {
		return status;
	}

	public void setStatus(pSpot status) {
		this.status = status;
	}

	public String getCarNumber() {
		if (status==pSpot.IN_USE)
			return carNumber;
		return "";
	}

	public void setCarNumber(String carNumber) {
		this.carNumber = carNumber;
	}

	public Date getEndParkTime() {
		return endParkTime;
	}

	public void setEndParkTime(Date endParkTime) {
		this.endParkTime = endParkTime;
	}
}
